package shop

import (
	"context"

	"sale-admin/internal/dao"

	"gorm.io/gorm"
)

type (
	ShopService      struct{}
	MaMerchantConfig struct {
		ID         string `gorm:"column:id" json:"id"`
		Username   string `gorm:"column:user_name" json:"user_name"`
		PaymentsID string `gorm:"column:payments_id" json:"payments_id"`
	}
)

// ShopInfoDetail 获取商户信息
func (s ShopService) ShopInfoDetail(ctx context.Context, db *gorm.DB, merchantID string) (ShopInfo MaMerchantConfig, err error) {
	info, _, err := dao.MerchantConfig{}.GetDetail(ctx, db, merchantID)
	ShopInfo = MaMerchantConfig{
		ID:         info.ID,
		Username:   info.Username,
		PaymentsID: info.PaymentsID,
	}
	return
}
